﻿<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%String path = request.getContextPath(); %> 
<!DOCTYPE html>
<html>
<head>
<title>学院公告</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="zh-CN" />
<link href="<%=path%>/resources/css/pages/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=path%>/resources/script/js/jquery-1.8.0.min.js" ></script>
<script src="<%=path%>/resources/script/js/vue.js"></script>
<script type="text/javascript" src="<%=path%>/resources/script/js/js.js" ></script>
<script type="text/javascript" src="<%=path%>/resources/script/js/jquery.simplePagination.js" ></script>
</head>
<body>
<div id="contentBody">
<div class="top">
  <div class="top-ct">
    <h3 class="logo"></h3> 
   <span id='span'>
       <a href="<%=path%>/pages/login" id='plogin'><span >您好，请登录！</span></a>
       <a href="<%=path%>/pages/userInfo?userid=${loginUser.id }" id='pshow'><span>${loginUser.nickName}（${loginUser.account }）</span></a>
    </span>
    <p><a href="<%=path%>/index" class="select">首页</a>
	    	<a href="<%=path%>/pages/mycourse?userid=${loginUser.id}">我的课程</a>
			<a href="<%=path%>/pages/learnhistory?userid=${loginUser.id}">学习历史</a>
			<a href="javascript:void(0);">我的技能</a></p>
<a id="toubu"></a> 
    </div>
</div>

<div id="main">
<div class="ny-ban"><img src="<%=path%>/resources/images/pages/images/ny-ban.jpg"></div>
<div class="position">
 <p><a href="<%=path%>/index" class="syx">首页</a> ><a href="javascript:void(0);">学院公告</a></p>
 <form>
  <label><input type="text"  placeholder="搜索新闻标题"  class="ssbt"></label>
  <label><input type="submit" class="ssan" value=""></label>
 
 </form>
</div>

<div class="ny-left">
 <h3><span id="collAd"></span><a href="<%=path%>/pages/noticeMoreAction.do?adType=1">系统公告</a></h3> 
 <h3><span id="sysAd"></span><a href="<%=path%>/pages/noticeMoreAction.do?adType=2">系统消息</a></h3>

</div>
<div class="ny-right">

<div class="news_list">
 <ul>
   <li v-for="item in collAdList"><a href="<%=path%>/pages/noticeAction.do?id={{item.id}}&adType={{item.nType}}">{{item.title}}</a><span>{{item.createTime.substr(0,10)}}</span></li>
</ul>
</div>
<div class="page_list" v-if="pagesLength>1">
 <div class="pagination-holder black clearfix">
		<ul id="dark-pagination" class="pagination"></ul>
</div>
 <form>跳转: <input type="text" name="page" class="page"> 页<input type="submit" name="submit" value="GO" class="go"> </form>

</div>

</div>


<div class="clear"></div>
</div>
<div class="foot">
<div class="foot-top"></div>
<div class="foot-ct"><p>Copyright © 2016 业主单位：福建工程学院，建设单位：福州森泽信息科技有限公司 技术服务热线：87862229
   <a href="#"><img src="<%=path%>/resources/images/pages/images/cnzz.jpg"></a></p></div>

</div>
<div class="fhdb">
  <a href="<%=path%>/index" id="sy"></a>
  <a href="#toubu" id="dingbu"></a>


</div>
</div>
<script type="text/javascript">
	$(document).ready(function() {
		var urlStr=location.search;
		var urlPara=[];
		var parObj=new Object();
		if(urlStr.indexOf("?")!=-1)
		{
			urlPara=urlStr.substr(urlStr.indexOf("?")+1).split("&");
		}
		for(var i=0;i<urlPara.length;i++)
		{
				parObj[urlPara[i].split("=")[0].toString()]=urlPara[i].split("=")[1].toString();
		}
		if(parObj["adType"]=="1")
		{
			$("#collAd").addClass("select");
			$("#sysAd").removeClass("select");
			$("#collAd a").attr("href","javascript:void(0)");
		}
		if(parObj["adType"]=="2")
		{
				$("#sysAd").addClass("select");
				$("#collAd").removeClass("select");
				$("#sysAd a").attr("href","javascript:void(0)");
		}
	});
	
	var vmMain=new Vue({
		el:'#contentBody',
		data:{
			collAdList:[],
                        pagesLength:0
		}
     });
	$.ajax({
	    url : 'notice',
	    type : 'POST',
	    dataType : 'json',
        data : {pageIndex:0,pageCount:8,adType:1},
		async:false,
 	    success : function(result)
 	    {	
 	    	for(var i=0;i<result.length;i++)
 	    	{
 	    		if(result[i].type=="学院公告")
    			{
    			    result[i].typeNmae='学院公告';
    			    result[i].nType=1;
    			}
 	    		else
 	    		{
 	    			result[i].typeNmae='系统信息';
 	    			result[i].nType=2;
 	    		}
 	    		 vmMain.collAdList.push(result[i]);
 	    	}
	    },
	    error:function(result)
	    {
 	    	return;
	    }	
    });
	var pageCount=Math.ceil(vmMain.collAdList.length/25);
        vmMain.pagesLength=pageCount;
	$('#dark-pagination').pagination({
		pages: pageCount,
		cssStyle: 'dark-theme',
		displayedPages: 3,
		edges: 2
	});

	
</script>
<script type="text/javascript"  language="JavaScript">
$(function(){
	var myName='${loginUser.account}';
	if(myName==""||myName==undefined)
	{
		document.getElementById('plogin').setAttribute("style", "display:inline");
		document.getElementById('pshow').setAttribute("style", "display:none");
	}
	else{
		document.getElementById('plogin').setAttribute("style", "display:none");
		document.getElementById('pshow').setAttribute("style", "display:inline");
	}
});
</script>
</body>
</html>
